import React, { useContext } from 'react'
import ReactReduxContext from '../ReactReduxContext'

/**
 * 获取仓库中的 dispatch
 */
function useDispatch() {
  const { store } = useContext(ReactReduxContext) // 获取上下文对象中的值
  return store.dispatch
}

export default useDispatch
